var Bee = {};

Bee.tabPanel = function(node){
    if (node.leaf) {
        var panelId = 'main-viewport-center-' + node.id;
        
        if (Ext.getCmp(panelId)) {
            Ext.getCmp(panelId).show();
            return;
        }
        
        Bee.center.loadMask.show();
        var panel = Ext.create('Ext.panel.Panel', {
            id: panelId,
            title: node.text,
            layout: 'fit',
            closable: true,
            loader: {
                url: 'panel/' + node.link,
                autoLoad: true,
                scripts: true
            }
        });
        Bee.center.add(panel);
        panel.show();
        Bee.center.loadMask.hide();
    }
};
